﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmoneyWeiXinCommon;
using EmoneyWeiXinEntity;

namespace EmoneyWeiXinDAL
{
    public class PropellingLogDAL
    {
        public int getPropellingUpdate(PropellingLogEntity porpeEn)
        {
            string sql = "";
            if (porpeEn.id > 0)
            {
                sql = " update PropellingLog set weixinid='" + porpeEn.weixinid + "',newsreportid='" + porpeEn.newsreportid + "',ToUsername='" + porpeEn.ToUsername + "',errorResult='" + porpeEn.errorResult + "',updatetime='" + porpeEn.updatetime + "' where id=" + porpeEn.id;
            }
            else
            {
                sql = " insert into PropellingLog(weixinid, newsreportid, ToUsername, errorResult, updatetime) values('" + porpeEn.weixinid + "','" + porpeEn.newsreportid + "','" + porpeEn.ToUsername + "','" + porpeEn.errorResult + "','" + porpeEn.updatetime + "')";
            }
            return SQLHelper.ExecuteNonQuery(Config.EmoneyWeiXin, System.Data.CommandType.Text, sql, null);
        }
    }
}
